﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace DotNETX.CommonWcfHost.Manager
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {

            System.Diagnostics.Process process = System.Diagnostics.Process.GetCurrentProcess();
            if (System.Diagnostics.Process.GetProcessesByName(process.ProcessName).Count() > 1)
            {
                int count = 0;
                foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcessesByName(process.ProcessName))
                {
                    if (p.MainModule.FileName == process.MainModule.FileName)
                    {
                        count++;
                    }
                    if (count > 1) return;
                }
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
    }
}
